package com.anne.fish.model;

import com.anne.fish.model.BaseObject;

import org.compass.annotations.Searchable;
import org.compass.annotations.SearchableComponent;
import org.compass.annotations.SearchableId;
import org.compass.annotations.SearchableProperty;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

import javax.xml.bind.annotation.XmlRootElement;

import java.io.Serializable;

@Entity
@Table(name="info_image",catalog="fish")
@Searchable
@XmlRootElement
public class InfoImage extends BaseObject implements Serializable {
    private Long id;
    private String big;
    private Long createTime;
    private Long infoId;
    private String small;
    private String source;
    private Long srcSizeHeight;
    private Long srcSizeWidth;

    @Id @GeneratedValue(strategy=IDENTITY) @SearchableId    
    public Long getId() {
        return this.id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    @Column(name="big", nullable=false)
    @SearchableProperty
    public String getBig() {
        return this.big;
    }
    
    public void setBig(String big) {
        this.big = big;
    }
    
    @Column(name="create_time", nullable=false)
    @SearchableProperty
    public Long getCreateTime() {
        return this.createTime;
    }
    
    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }
    
    @Column(name="info_id", nullable=false)
    @SearchableProperty
    public Long getInfoId() {
        return this.infoId;
    }
    
    public void setInfoId(Long infoId) {
        this.infoId = infoId;
    }
    
    @Column(name="small", nullable=false)
    @SearchableProperty
    public String getSmall() {
        return this.small;
    }
    
    public void setSmall(String small) {
        this.small = small;
    }
    
    @Column(name="source", nullable=false)
    @SearchableProperty
    public String getSource() {
        return this.source;
    }
    
    public void setSource(String source) {
        this.source = source;
    }
    
    @Column(name="src_size_height", nullable=false)
    @SearchableProperty
    public Long getSrcSizeHeight() {
        return this.srcSizeHeight;
    }
    
    public void setSrcSizeHeight(Long srcSizeHeight) {
        this.srcSizeHeight = srcSizeHeight;
    }
    
    @Column(name="src_size_width", nullable=false)
    @SearchableProperty
    public Long getSrcSizeWidth() {
        return this.srcSizeWidth;
    }
    
    public void setSrcSizeWidth(Long srcSizeWidth) {
        this.srcSizeWidth = srcSizeWidth;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        InfoImage pojo = (InfoImage) o;

        if (big != null ? !big.equals(pojo.big) : pojo.big != null) return false;
        if (createTime != null ? !createTime.equals(pojo.createTime) : pojo.createTime != null) return false;
        if (infoId != null ? !infoId.equals(pojo.infoId) : pojo.infoId != null) return false;
        if (small != null ? !small.equals(pojo.small) : pojo.small != null) return false;
        if (source != null ? !source.equals(pojo.source) : pojo.source != null) return false;
        if (srcSizeHeight != null ? !srcSizeHeight.equals(pojo.srcSizeHeight) : pojo.srcSizeHeight != null) return false;
        if (srcSizeWidth != null ? !srcSizeWidth.equals(pojo.srcSizeWidth) : pojo.srcSizeWidth != null) return false;

        return true;
    }

    public int hashCode() {
        int result = 0;
        result = (big != null ? big.hashCode() : 0);
        result = 31 * result + (createTime != null ? createTime.hashCode() : 0);
        result = 31 * result + (infoId != null ? infoId.hashCode() : 0);
        result = 31 * result + (small != null ? small.hashCode() : 0);
        result = 31 * result + (source != null ? source.hashCode() : 0);
        result = 31 * result + (srcSizeHeight != null ? srcSizeHeight.hashCode() : 0);
        result = 31 * result + (srcSizeWidth != null ? srcSizeWidth.hashCode() : 0);

        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("id").append("='").append(getId()).append("', ");
        sb.append("big").append("='").append(getBig()).append("', ");
        sb.append("createTime").append("='").append(getCreateTime()).append("', ");
        sb.append("infoId").append("='").append(getInfoId()).append("', ");
        sb.append("small").append("='").append(getSmall()).append("', ");
        sb.append("source").append("='").append(getSource()).append("', ");
        sb.append("srcSizeHeight").append("='").append(getSrcSizeHeight()).append("', ");
        sb.append("srcSizeWidth").append("='").append(getSrcSizeWidth()).append("'");
        sb.append("]");
      
        return sb.toString();
    }

}
